unit utipos;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, Grids, DBGrids, DBTables, StdCtrls, Buttons;

type
  TFtipos = class(TForm)
    DBGrid1: TDBGrid;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    BitBtn3: TBitBtn;
    procedure BitBtn4Click(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
    procedure BitBtn3Click(Sender: TObject);
    procedure FormKeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Ftipos: TFtipos;
  inclusao, alteracao, exclusao : boolean;

implementation

uses Utiposmanutencao,udados;

{$R *.dfm}

procedure TFtipos.BitBtn4Click(Sender: TObject);
begin
close;
end;

procedure TFtipos.BitBtn1Click(Sender: TObject);
begin
inclusao := true;
application.createform(tftiposmanutencao,ftiposmanutencao);
ftiposmanutencao.ShowModal;
ftiposmanutencao.Release;
inclusao := false;
end;

procedure TFtipos.BitBtn2Click(Sender: TObject);
begin
alteracao := true;
application.createform(tftiposmanutencao,ftiposmanutencao);
ftiposmanutencao.ShowModal;
ftiposmanutencao.Release;
alteracao := false;
end;

procedure TFtipos.BitBtn3Click(Sender: TObject);
begin
exclusao := true;
application.createform(tftiposmanutencao,ftiposmanutencao);
ftiposmanutencao.ShowModal;
ftiposmanutencao.Release;
exclusao := false;

end;

procedure TFtipos.FormKeyPress(Sender: TObject; var Key: Char);
begin
  if key=#13 then
     SelectNext(ActiveControl,true,true);
  if key=#27 then
     close;

end;

end.
